from flask import Blueprint
from .view.users import user as user_bp
from .view.goods import good as good_bp
from .view.order import order as order_bp

def create_app():
    # 创建主蓝图（不再使用 Flask，而是 Blueprint）
    main_bp = Blueprint('main', __name__, static_folder='../static')

    # 注册子蓝图（user, goods, shopCar, comment, order）
    main_bp.register_blueprint(user_bp, url_prefix='/user')
    main_bp.register_blueprint(good_bp, url_prefix='/good')
    main_bp.register_blueprint(order_bp, url_prefix='/order')

    return main_bp  # 返回蓝图对象